<#macro amPagination urls=[] current=1>
<ul class="am-pagination">
	<#list urls as url>
		<li <#if current = url[1]>class="am-active"</#if>><a href="${rc.contextPath}${urlName}/page/${url[1]}">${url[0]}</a></li>
	</#list>
	<#-- am-disabled am-active -->
</ul>
<script type="text/javascript">
	$(function(){
		$(".am-pagination a").bind("click", function(){
			$.get($(this).attr("href"),function(data){
				$("#id-main-frame").html(data);	
			});
			return false;
		});
	});
</script>
</#macro>

<#macro editormdJs id="id_editormd" jsList=[] htmlDecode="false">
<#list jsList as jsFilePath>
<script type="text/javascript">
	var jsTag = document.createElement('script');
	jsTag.type = "text/javascript";
	jsTag.src  = "${rc.contextPath}/resources${jsFilePath}";
	document.head.appendChild(jsTag);
</script>
</#list>
<script type="text/javascript">
	var editormdElement;
	$(function() {
		editormdElement = editormd("${id}", {
			width : "100%",
			height : 540,
			syncScrolling : "single",
			path : "${rc.contextPath}/resources/editormd/lib/",
			imageUpload : true,
			imageFormats : [ "jpg", "jpeg", "gif", "png", "bmp", "webp" ],
			imageUploadURL : "/uploadfile",
			saveHTMLToTextarea : true,
			previewTheme : "dark",
			toolbarIcons : function() {
           		return  ["bold", "del", "italic", "hr", "image", "qiniu", "table", "datetime", "|", "preview", "watch", "|", "fullscreen"];
           	},
           	//配置七牛上传插件
           	toolbarIconsClass : {
                qiniu : "fa-cloud-upload"
            },
            toolbarHandlers : {
                qiniu : function(cm, icon, cursor, selection) {
                	this.imageDialogQiniu();
                }
            },
            qiniuTokenUrl : "/getQiniuToken",						//本地服务器获取七牛token的url
            qiniuPublishUrl : "https://ojtkyre9w.qnssl.com/",	//远程七牛服务器个人发布地址
            csrf_key      : "${_csrf.parameterName}",				//spring security 防 CSRF 攻击key
            csrf_value    : "${_csrf.token}",						//spring security 防 CSRF 攻击value
            htmlDecode	  : "${htmlDecode}",						//是否开启html解析，默认不开启				
		});
	});
</script>
</#macro>